package com.jeesite.modules.ic.api;

import com.alibaba.fastjson.JSONObject;
import com.jeesite.common.lang.DateUtils;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.modules.config.CardStatus;
import com.jeesite.modules.ic.entity.IcCard;
import com.jeesite.modules.ic.entity.IcUser;
import com.jeesite.modules.ic.service.IcCardService;
import com.jeesite.modules.ic.service.IcUserService;
import com.jeesite.modules.utils.wx.WxMini;
import com.jeesite.modules.utils.wx.vo.PushCard;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {


    @Autowired
    private WxMini wxMini;

    /**
     * 泽米卡状态回调
     * @param jsonObject
     * @return
     * {
     *     "previousVal":"1",  //之前值：设备状态变更1:已激活；2:可激活；3:已停用；4:已失效；5:可测试；6:库存；7:已更换；8:已清除;
     *     "currentVal":"3",  //当前值：设备状态变更1:已激活；2:可激活；3:已停用；4:已失效；5:可测试；6:库存；7:已更换；8:已清除;
     *     "reason":0,
     *     "iccid":"8986061509000003300",
     *     "sign":"9430F2B576DABA1C6374CB0FA82B7E29F65527B6FB3E1182474A751B4070AF1C",
     *     "time":"20210428134933",
     *     "serialNo":1380423992295354368,
     *     "type":"DEVICE_STATUS_CHANGE"
     * }
     */
    @RequestMapping("cardStatusCallbackZM")
    public String cardStatusCallbackZM(@RequestBody JSONObject jsonObject){
        wxMini.createMenu(jsonObject);
        return "ok";
    }



}
